#include <iostream>
using namespace std;
#define N 25
int main()
{
	int n, l[N], r[N], u[N];
	l[1] = r[1] = u[1] = 1;
	cin >> n;
	for(int i = 2; i <= n; ++i)
	{
	    l[i] = l[i-1] + u[i-1];
	    r[i] = r[i-1] + u[i-1];
	    u[i] = l[i-1] + r[i-1] + u[i-1];
    }
	cout << l[n] + r[n] + u[n];
	return 0;
}
